home *** CD-ROM | disk | FTP | other *** search
/ Aminet 22 / Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso / Aminet / dev / src / RLD_source.lha / RLD_source / debugstub.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-22  |  1.4 KB  |  47 lines

  1. /*
  2.   $Id: debugstub.h,v 1.2 1997/10/21 22:35:08 wegge Stab wegge $
  3.    
  4.   $Log: debugstub.h,v $
  5.   Revision 1.2  1997/10/21 22:35:08  wegge
  6.   Snapshot inden upload af 2.13 i source og binær form
  7.  
  8.   Revision 1.1  1997/10/21 07:59:11  wegge
  9.   Initial revision
  10.  
  11.   */
  12.  
  13. #if !defined(DEBUGSTUB_H)
  14. #define DEBUGSTUB_H
  15.  
  16. void KPrintF(const char *format, ...);
  17.  
  18. #if defined(DEBUG_VERSION)
  19.  
  20. #define KPRINTF_HERE         do { KPrintF ("%s(%s):%ld\n", \
  21.                              __FUNCTION__, __FILE__, __LINE__); } while (0)
  22. #define KPRINTF_WHERE         do { KPrintF ("%s(%s):%ld:\n    ", \
  23.                              __FUNCTION__, __FILE__, __LINE__); } while (0)
  24. #define KPRINTF_ARGS(a)         do { KPrintF a; } while (0)
  25. #define KPRINTF(a)         do { KPRINTF_WHERE; KPRINTF_ARGS(a); } while (0)
  26. #define KPRINTF_DISABLED(a)  do { Disable (); KPRINTF (a); \
  27.                              Enable (); } while (0)
  28.  
  29. #define KPRINTF_ARGV(name,argv) \
  30.   do { int argi; \
  31.     for (argi = 0; (argv)[argi] != NULL; argi++) \
  32.       KPRINTF (("%s[%ld] = [%s]\n", (name), argi, (argv)[argi])); \
  33.   } while (0)
  34.  
  35. #else  /* !defined(DEBUG_VERSION) */
  36.  
  37. #define KPRINTF_HERE            /* Expands to nothing */
  38. #define KPRINTF_WHERE            /* Expands to nothing */
  39. #define KPRINTF_ARGS(a)            /* Expands to nothing */
  40. #define KPRINTF(a)            /* Expands to nothing */
  41. #define KPRINTF_DISABLED(a)        /* Expands to nothing */
  42. #define KPRINTF_ARGV(name,argv)        /* Expands to nothing */
  43.  
  44. #endif /* DEBUG_VERSION */
  45.  
  46. #endif /* DEBUGSTUB_H */
  47.